Questions:

Does a model derived gradient between wetlands and uplands correspond to a gradient of soil development along a catena/hillslope characterized in a hydropedological framework?

If the ends of the wetland/upland classification are accurate, does the intermediate range correspond with hypothesized soil formation characteristics according to a hydropedological framework?

hydropedology hillslope model from Bailey et al., 2014
hydropedology hillslope model from Bailey et al., 2014

The Hubbard Brook Experimental Forest

From Hubbard Brook website https://hubbardbrook.org/about-the-forest/:

Hydropedological units in the Hubbard Brook Experimental Forest include:

## [1] "ATTRIBUTE"  "WETLAND_TY" "ACRES"      "Shape_Leng" "Shape_Area"

Merge hydrography and NWI

Get training data - wetland and upland points

Make terrain metrics

hbslp_3 <- SlpAsp(hbdem, w = c(3, 3), metrics = "slope", filename = "UplandWetlandGradient/data/derived_data/hbslp_3.tif",
    overwrite = T)

hbslp_27 <- SlpAsp(hbdem, w = c(27, 27), metrics = "slope", filename = "UplandWetlandGradient/data/derived_data/hbslp_27.tif",
    overwrite = T)

hbslp_81 <- SlpAsp(hbdem, w = c(81, 81), metrics = "slope", filename = "UplandWetlandGradient/data/derived_data/hbslp_81.tif",
    overwrite = T)
hbtpi_3 <- TPI(hbdem, w = c(3, 3), shape = "rectangle", stand = "none",
    na.rm = TRUE, filename = "UplandWetlandGradient/data/derived_data/hbtpi_3.tif",
    overwrite = T)

hbtpi_27 <- TPI(hbdem, w = c(27, 27), shape = "rectangle", stand = "none",
    na.rm = TRUE, filename = "UplandWetlandGradient/data/derived_data/hbtpi_27.tif",
    overwrite = T)

hbtpi_81 <- TPI(hbdem, w = c(81, 81), shape = "rectangle", stand = "none",
    na.rm = TRUE, filename = "UplandWetlandGradient/data/derived_data/hbtpi_81.tif",
    overwrite = T)
hbcurv_3 <- Qfit(hbdem, w = c(3, 3), metrics = c("meanc", "profc",
    "planc"), unit = "degrees", na.rm = TRUE, filename = "UplandWetlandGradient/data/derived_data/hbcurv_3.tif",
    overwrite = T)

hbcurv_27 <- Qfit(hbdem, w = c(27, 27), metrics = c("meanc",
    "profc", "planc"), unit = "degrees", na.rm = TRUE, filename = "UplandWetlandGradient/data/derived_data/hbcurv_27.tif",
    overwrite = T)

hbcurv_81 <- Qfit(hbdem, w = c(81, 81), metrics = c("meanc",
    "profc", "planc"), unit = "degrees", na.rm = TRUE, filename = "UplandWetlandGradient/data/derived_data/hbcurv_81.tif",
    overwrite = T)

Slope at different scales

TPI at different scales

Curvature at different scales

Slope at 3m vs. 81m

TPI at 3m vs. 81m

Mean Curvature at 3m vs. 81m

Is resampling the same as setting the window size larger?

##  [1] "class"        "dem"          "slp_3"        "slp_27"       "slp_81"      
##  [6] "meancurv_3"   "prof_curv_3"  "plan_curv_3"  "meancurv_27"  "prof_curv_27"
## [11] "plan_curv_27" "meancurv_81"  "prof_curv_81" "plan_curv_81" "tpi_3"       
## [16] "tpi_27"       "tpi_81"       "x"            "y"            "meanc"       
## [21] "profc"        "planc"
##  class       : SpatVector 
##  geometry    : points 
##  dimensions  : 2246, 22  (geometries, attributes)
##  extent      : 274043.4, 283958.1, 4866042, 4871958  (xmin, xmax, ymin, ymax)
##  coord. ref. : NAD83 / UTM zone 19N (EPSG:26919) 
##  names       :  class   dem slp_3 slp_27 slp_81 meancurv_3 prof_curv_3
##  type        : <fact> <num> <num>  <num>  <num>      <num>       <num>
##  values      :    UPL 333.2 14.31  12.14  9.286   -0.02777    -0.04499
##                   UPL 745.8 15.09  8.697  12.81   -0.03448     0.00313
##                   UPL   584 14.21  15.18  15.11   0.001648    0.007331
##  plan_curv_3 meancurv_27 prof_curv_27 (and 12 more)
##        <num>       <num>        <num>              
##     -0.01056   0.0003643   -0.0001417              
##     -0.07208  -0.0001351     0.008627              
##    -0.004036    0.002487     0.003541

Set up random forest model

## randomForest 4.7-1.1
## Type rfNews() to see new features/changes/bug fixes.
## 
## Attaching package: 'randomForest'
## The following object is masked from 'package:dplyr':
## 
##     combine
## The following object is masked from 'package:spatialEco':
## 
##     combine
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  UPL  WET
##        UPL 1264    0
##        WET    0  309
##                                      
##                Accuracy : 1          
##                  95% CI : (0.9977, 1)
##     No Information Rate : 0.8036     
##     P-Value [Acc > NIR] : < 2.2e-16  
##                                      
##                   Kappa : 1          
##                                      
##  Mcnemar's Test P-Value : NA         
##                                      
##             Sensitivity : 1.0000     
##             Specificity : 1.0000     
##          Pos Pred Value : 1.0000     
##          Neg Pred Value : 1.0000     
##              Prevalence : 0.8036     
##          Detection Rate : 0.8036     
##    Detection Prevalence : 0.8036     
##       Balanced Accuracy : 1.0000     
##                                      
##        'Positive' Class : UPL        
## 
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction UPL WET
##        UPL 528  25
##        WET  14 108
##                                           
##                Accuracy : 0.9422          
##                  95% CI : (0.9219, 0.9586)
##     No Information Rate : 0.803           
##     P-Value [Acc > NIR] : <2e-16          
##                                           
##                   Kappa : 0.8115          
##                                           
##  Mcnemar's Test P-Value : 0.1093          
##                                           
##             Sensitivity : 0.9742          
##             Specificity : 0.8120          
##          Pos Pred Value : 0.9548          
##          Neg Pred Value : 0.8852          
##              Prevalence : 0.8030          
##          Detection Rate : 0.7822          
##    Detection Prevalence : 0.8193          
##       Balanced Accuracy : 0.8931          
##                                           
##        'Positive' Class : UPL             
## 

AUC/ROC

## [1] "Area under the ROC curve"
## [[1]]
## [1] 0.8930999

Predict maps

PDF/kernel density plot

## Warning: [hist] a sample of17% of the cells was used (of which 5% was NA)